package Administration;

import pojo.hibernate.Budgettypemaster;
import pojo.hibernate.BudgettypemasterDAO;

import utils.DevelopmentSupport;
import java.util.ArrayList;
import java.util.List;

public class BudgettypemasterAction extends DevelopmentSupport {
    private Budgettypemaster budgettypemaster;
    private Integer btmId;
    private String btmName;
     
    private BudgettypemasterDAO budgettypemasterDao = new BudgettypemasterDAO();   
    private List<Budgettypemaster> budgettypemasterList = new ArrayList<Budgettypemaster>();

    String message;
    
     public String getMessage() {
        return message;
    }

    @Override

    public String execute() throws Exception {
    
       try{
       //    budgettypemaster.setbtmName("Hello");
       message = "Here it enter Budget Type Management";
       

          // budgettypemaster = new Budgettypemaster();
           
         //  budgettypemasterDao.save(budgettypemaster);
           //message = message +  budgettypemaster.getbtmName();

       List<Budgettypemaster> list = budgettypemasterDao.findAll();
 //       budgettypemaster = budgettypemasterDao.RetrieveBudget(1);
        message = message + list.get(0).getbtmName() + "  --  " + budgettypemaster.getbtmName();

        
       
        }
       catch (Exception e)
       {
           message = message + e.getCause() + e.getMessage();
         return SUCCESS;
       }
        return SUCCESS;
    }
/*
    public String edit() {
        budgetTypeMasterList = BudgettypemasterDao.findAll();
        budgettypemaster  = BudgettypemasterDao.RetrieveBudget(getbtmName());

        return SUCCESS;
    }

    public String delete() {
        
        Budgettypemaster  budgettypemasterForDelete = BudgettypemasterDao.RetrieveBudget(getbtmName());
        BudgettypemasterDao.delete(budgettypemasterForDelete);
        budgetTypeMasterList = BudgettypemasterDao.findAll();
        return SUCCESS;
    }

    public String clear() {
        budgettypemaster = new Budgettypemaster();
        return SUCCESS;
    }

    public Budgettypemaster getBudgettypemaster() {
        return budgettypemaster;
    }

    public void setBudgettypemaster(Budgettypemaster budgettypemaster) {
        this.budgettypemaster = budgettypemaster;
    }

    public Integer getbtmID() {
        return btmId;
    }

    public void setbtmID(Integer btmId) {
        this.btmId = btmId;
    }
*/
     public String getbtmName() {
        return btmName;
    }

    public void setbtmName(String btmName) {
        this.btmName = btmName;
    }
/*
    public List<Budgettypemaster> getBudgetmastertypeList() {
        return budgetTypeMasterList;
    }
    public void setBudgetmastertypeList(List<Budgettypemaster> budgetTypeMasterList) {
        this.budgetTypeMasterList = budgetTypeMasterList;
    }

  */
    }